package com.example.administrator.printoutindemo;

import android.content.Context;

import com.example.administrator.printoutindemo.bean.VOOutStorageList;
import com.google.gson.Gson;

import java.io.Serializable;


public class OutStorageList implements Serializable {

    private int _out_storageList_id = 0;
    private int _material_id;
    private String _materialInfo;
    private String _out_storage_estimate;
    private String _out_storage_count;
    private int _material_user_id;
    private int _check_user_id;
    private String _check_user_name;
    private String _check_status;
    private String _deal_status;
    private String _receive_address;
    private String _receive_username;
    private String _receive_userphone;
    private String _out_storagelist_batchid;
    private String _target_project;
    private String _proid;
    private String _projectName;
    private String _check_reason = "";
    private int _submituid = 0;

    private String _receive_loginName = "";
    private String _receive_loginPwd = "";
    private String _receive_loginTrueName = "";
    private String shenQingRen = "";
    private String materialCode = "";
    private String unit = "";

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getShenQingRen() {
        return shenQingRen;
    }

    public void setShenQingRen(String shenQingRen) {
        this.shenQingRen = shenQingRen;
    }
//	private SQLiteDBService sqliteDBservice;

    public OutStorageList() {

    }

    public OutStorageList(Context context) {
//		sqliteDBservice = new SQLiteDBService(context);
    }

    public String ConvertToJson(OutStorageList model) {
        String jsonStr = "";
        VOOutStorageList voOutStorageList = new VOOutStorageList();
//        JSONObject modelJsonObject = new JSONObject();
        try {
//            modelJsonObject.put("out_storageList_id", model.get_out_storageList_id());
//            modelJsonObject.put("material_id", model.get_material_id());
//            modelJsonObject.put("out_storage_estimate", model.get_out_storage_estimate());
//            modelJsonObject.put("out_storage_count", model.get_out_storage_count());
//            modelJsonObject.put("material_user_id", model.get_material_user_id());
//            modelJsonObject.put("check_user_id", model.get_check_user_id());
//            modelJsonObject.put("check_user_name", model.get_check_user_name());
//            modelJsonObject.put("check_status", model.get_check_status());
//            modelJsonObject.put("deal_status", model.get_deal_status());
//            modelJsonObject.put("receive_address", model.get_receive_address());
//            modelJsonObject.put("receive_username", model.get_receive_username());
//            modelJsonObject.put("receive_userphone", model.get_receive_userphone());
//            modelJsonObject.put("target_project", model.get_target_project());
//            modelJsonObject.put("out_storagelist_batchid", model.get_out_storagelist_batchid());
//            modelJsonObject.put("check_reason", model.get_check_reason());
//            modelJsonObject.put("submituid", model.get_submituid());
//
//            modelJsonObject.put("receive_loginName", model.get_receive_loginName());
//            modelJsonObject.put("receive_loginPwd", model.get_receive_loginPwd());
//            modelJsonObject.put("receive_loginTrueName", model.get_receive_loginTrueName());
//
//            jsonStr = modelJsonObject.toString();


            voOutStorageList.setOut_storageList_id(model.get_out_storageList_id());
            voOutStorageList.setMaterial_id(model.get_material_id());
            voOutStorageList.setOut_storage_estimate(model.get_out_storage_estimate());
            voOutStorageList.setOut_storage_count(model.get_out_storage_count());
            voOutStorageList.setMaterial_user_id(model.get_material_user_id());
            voOutStorageList.setCheck_user_id(model.get_check_user_id());
            voOutStorageList.setCheck_user_name(model.get_check_user_name());
            voOutStorageList.setCheck_status(model.get_check_status());
            voOutStorageList.setDeal_status(model.get_deal_status());
            voOutStorageList.setReceive_address(model.get_receive_address());
            voOutStorageList.setReceive_username(model.get_receive_username());
            voOutStorageList.setReceive_userphone(model.get_receive_userphone());
            voOutStorageList.setTarget_project(model.get_target_project());
            voOutStorageList.setOut_storagelist_batchid(model.get_out_storagelist_batchid());
            voOutStorageList.setCheck_reason(model.get_check_reason());
            voOutStorageList.setSubmituid(model.get_submituid());

            voOutStorageList.setReceive_loginName(model.get_receive_loginName());
            voOutStorageList.setReceive_loginPwd(model.get_receive_loginPwd());
            voOutStorageList.setReceive_loginTrueName(model.get_receive_loginTrueName());
            Gson g = new Gson();
            jsonStr = g.toJson(voOutStorageList);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonStr;
    }

    public VOOutStorageList ConvertToJson1(OutStorageList model) {

        VOOutStorageList voOutStorageList = new VOOutStorageList();

        try {

            voOutStorageList.setOut_storageList_id(model.get_out_storageList_id());
            voOutStorageList.setMaterial_id(model.get_material_id());
            voOutStorageList.setOut_storage_estimate(model.get_out_storage_estimate());
            voOutStorageList.setOut_storage_count(model.get_out_storage_count());
            voOutStorageList.setMaterial_user_id(model.get_material_user_id());
            voOutStorageList.setCheck_user_id(model.get_check_user_id());
            voOutStorageList.setCheck_user_name(model.get_check_user_name());
            voOutStorageList.setCheck_status(model.get_check_status());
            voOutStorageList.setDeal_status(model.get_deal_status());
            voOutStorageList.setReceive_address(model.get_receive_address());
            voOutStorageList.setReceive_username(model.get_receive_username());
            voOutStorageList.setReceive_userphone(model.get_receive_userphone());
            voOutStorageList.setTarget_project(model.get_target_project());
            voOutStorageList.setOut_storagelist_batchid(model.get_out_storagelist_batchid());
            voOutStorageList.setCheck_reason(model.get_check_reason());
            voOutStorageList.setSubmituid(model.get_submituid());

            voOutStorageList.setReceive_loginName(model.get_receive_loginName());
            voOutStorageList.setReceive_loginPwd(model.get_receive_loginPwd());
            voOutStorageList.setReceive_loginTrueName(model.get_receive_loginTrueName());

        } catch (Exception e) {
            e.printStackTrace();
        }
        return voOutStorageList;
    }


    public String get_receive_loginName() {
        return _receive_loginName;
    }

    public void set_receive_loginName(String _receive_loginName) {
        this._receive_loginName = _receive_loginName;
    }

    public String get_receive_loginPwd() {
        return _receive_loginPwd;
    }

    public void set_receive_loginPwd(String _receive_loginPwd) {
        this._receive_loginPwd = _receive_loginPwd;
    }

    public String get_receive_loginTrueName() {
        return _receive_loginTrueName;
    }

    public void set_receive_loginTrueName(String _receive_loginTrueName) {
        this._receive_loginTrueName = _receive_loginTrueName;
    }

    public String get_check_reason() {
        return _check_reason;
    }

    public void set_check_reason(String _check_reason) {
        this._check_reason = _check_reason;
    }

    public int get_out_storageList_id() {
        return _out_storageList_id;
    }

    public void set_out_storageList_id(int _out_storageList_id) {
        this._out_storageList_id = _out_storageList_id;
    }

    public String get_materialInfo() {
        return _materialInfo;
    }

    public void set_materialInfo(String _materialInfo) {
        this._materialInfo = _materialInfo;
    }

    public String get_projectName() {
        return _projectName;
    }

    public void set_projectName(String _projectName) {
        this._projectName = _projectName;
    }

    public String get_check_user_name() {
        return _check_user_name;
    }

    public void set_check_user_name(String _check_user_name) {
        this._check_user_name = _check_user_name;
    }

    public String get_proid() {
        return _proid;
    }

    public void set_proid(String _proid) {
        this._proid = _proid;
    }

    public int get_material_id() {
        return _material_id;
    }

    public void set_material_id(int _material_id) {
        this._material_id = _material_id;
    }

    public String get_out_storage_estimate() {
        return _out_storage_estimate;
    }

    public void set_out_storage_estimate(String _out_storage_estimate) {
        this._out_storage_estimate = _out_storage_estimate;
    }

    public String get_out_storage_count() {
        return _out_storage_count;
    }

    public void set_out_storage_count(String _out_storage_count) {
        this._out_storage_count = _out_storage_count;
    }

    public int get_material_user_id() {
        return _material_user_id;
    }

    public void set_material_user_id(int _material_user_id) {
        this._material_user_id = _material_user_id;
    }

    public int get_check_user_id() {
        return _check_user_id;
    }

    public void set_check_user_id(int _check_user_id) {
        this._check_user_id = _check_user_id;
    }

    public String get_check_status() {
        return _check_status;
    }

    public void set_check_status(String _check_status) {
        this._check_status = _check_status;
    }

    public String get_deal_status() {
        return _deal_status;
    }

    public void set_deal_status(String _deal_status) {
        this._deal_status = _deal_status;
    }

    public String get_receive_address() {
        return _receive_address;
    }

    public void set_receive_address(String _receive_address) {
        this._receive_address = _receive_address;
    }

    public String get_receive_username() {
        return _receive_username;
    }

    public void set_receive_username(String _receive_username) {
        this._receive_username = _receive_username;
    }

    public String get_receive_userphone() {
        return _receive_userphone;
    }

    public void set_receive_userphone(String _receive_userphone) {
        this._receive_userphone = _receive_userphone;
    }

    public String get_out_storagelist_batchid() {
        return _out_storagelist_batchid;
    }

    public void set_out_storagelist_batchid(String _out_storagelist_batchid) {
        this._out_storagelist_batchid = _out_storagelist_batchid;
    }

    public String get_target_project() {
        return _target_project;
    }

    public void set_target_project(String _target_project) {
        this._target_project = _target_project;
    }

    public int get_submituid() {
        return _submituid;
    }

    public void set_submituid(int _submituid) {
        this._submituid = _submituid;
    }
//	// ��������SQLite
//	public void add(OutStorageList n) {
//		String sql = " insert into OutStorageList(material_id,out_storage_estimate,out_storage_count,material_user_id,"
//				+ "check_user_id,check_status,deal_status,receive_address,"
//				+ "receive_username,receive_userphone,out_storagelist_batchid,target_project ) "
//				+ "values(?,?,?,?,?,?,?,?,?,?,?,?) ";
//
//		sqliteDBservice
//				.execSQL(
//						sql,
//						new Object[] { n.get_material_id(),
//								n.get_out_storage_estimate(),
//								n.get_out_storage_count(),
//								n.get_material_user_id(),
//								n.get_check_user_id(), n.get_check_status(),
//								n.get_deal_status(), n.get_receive_address(),
//								n.get_receive_username(),
//								n.get_receive_userphone(),
//								n.get_out_storagelist_batchid(),
//								n.get_target_project() });
//
//	}
//
//	// ��������SQLite
//	public void update(OutStorageList n) {
//		String sql = " update  OutStorageList set "
//				+ ",out_storage_estimate ='"
//				+ n.get_out_storage_estimate()
//				+ "'"
//				+ ",out_storage_count = '"
//				+ n.get_out_storage_count()
//				+ "'"
//				+ ",material_user_id = "
//				+ n.get_material_user_id()
//				+ ",check_user_id = "
//				+ n.get_check_user_id()
//				+ ",check_status = '"
//				+ n.get_check_status()
//				+ "'"
//				+ ",deal_status = '"
//				+ n.get_deal_status()
//				+ "'"
//				+ ",receive_address = '"
//				+ n.get_receive_address()
//				+ "'"
//				+ ",receive_username = '"
//				+ n.get_receive_username()
//				+ "'"
//				+ ",receive_userphone ='"
//				+ n.get_receive_userphone()
//				+ "'"
//				+ ",target_project = '"
//				+ n.get_target_project()
//				+ "'"
//				+ " where  out_storagelist_batchid = '"
//				+ n.get_out_storagelist_batchid()
//				+ "'"
//				+ " and material_id = "
//				+ n.get_material_id();
//
//		sqliteDBservice.execSQL(sql);
//
//	}
//
//	// ��ȡList�б�(��SQLite�л�ȡ)
//	public List<OutStorageList> getList(OutStorageList ny, String selection) {
//		List<OutStorageList> li = new ArrayList<OutStorageList>();
//
//		Cursor cr = sqliteDBservice.query("OutStorageList", new String[] {
//				"material_id", "out_storage_estimate", "out_storage_count",
//				"material_user_id", "check_user_id", "check_status",
//				"deal_status", "receive_address", "receive_username",
//				"receive_userphone", "target_project",
//				"out_storagelist_batchid" }, selection, null, null, null, null);
//
//		while (cr.moveToNext()) {
//			OutStorageList n = new OutStorageList();
//
//			n.set_material_id(cr.getInt(0));
//			n.set_out_storage_estimate(cr.getString(1));
//			n.set_out_storage_count(cr.getString(2));
//			n.set_material_user_id(cr.getInt(3));
//			n.set_check_user_id(cr.getInt(4));
//			n.set_check_status(cr.getString(5));
//			n.set_deal_status(cr.getString(6));
//			n.set_receive_address(cr.getString(7));
//			n.set_receive_username(cr.getString(8));
//			n.set_receive_userphone(cr.getString(9));
//			n.set_target_project(cr.getString(10));
//			n.set_out_storagelist_batchid(cr.getString(11));
//
//			li.add(n);
//
//		}
//
//		cr.close();
//		sqliteDBservice.closeDBHelper();
//		return li;
//	}
}
